package ${req.packageName};

import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ${req.comment!}
 * @author 江路
 * @note generate by codemaker
 */
@AllArgsConstructor
@Getter
public enum ${req.clazzName?cap_first} {

    <#list rsp as item>
    ${item.enumCodeString}("${item.enumCodeString}","${item.enumMessage}")<#if item_has_next>,<#else>;</#if>
    </#list>

	private String code;
	private String message;

	public static ${req.clazzName?cap_first} getEnumByMessage(String message) {
		if (message == null)
			return null;
		for (${req.clazzName?cap_first} _enum : values()) {
			if (_enum.getMessage().equalsIgnoreCase(message)) {
				return _enum;
			}
		}
		return null;
	}

	/**
	 * 获取所有枚举
	 * 
	 * @return List<${req.clazzName?cap_first}>
	 */
	public static List<${req.clazzName?cap_first}> getAllEnum() {
		List<${req.clazzName?cap_first}> list = new java.util.ArrayList<${req.clazzName?cap_first}>(values().length);
		for (${req.clazzName?cap_first} _enum : values()) {
			list.add(_enum);
		}
		return list;
	}

	/**
	 * 获取所有枚举Code
	 * 
	 * @return List<String>
	 */
	public static List<String> getAllEnumCode() {
		List<String> list = new java.util.ArrayList<String>(values().length);
		for (${req.clazzName?cap_first} _enum : values()) {
			list.add(_enum.getCode());
		}
		return list;
	}
}